At 19:47 +0300 on 25/04/1999, Tom Lane wrote:
>
> This is where you need table aliases (AS clauses). You do it like this:
>
> select project.id, project.name, p1.name, p2.name
> from project, people as p1, people as p2 where
> project.mainpersonid = p1.id and project.standbypersonid = p2.id;
No, AS is for field aliasing, not table aliasing.
The proper syntax is
SELECT project.id, project.name, p1.name, p2.name
FROM project, people p1, people p2
WHERE project.mainpersonid = p1.id AND project.standbypersonid = p2.id;
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma